One goal of a computer operating system is to provide safe and efficient access to I/O devices, such as network communication adapters, permanent storage devices, audio devices, and video devices. The I/O performance of an operating system is affected by the need to translate virtual memory addresses utilized by application programs to physical memory addresses used by hardware devices. For example, in order to access I/O devices, application programs issue I/O requests to the operating system specifying the virtual memory address of data to be written to an I/O device or the virtual memory address where data received from an I/O device is to be stored. A memory manager unit (MMU), which is a hardware component of the host computer, translates virtual memory addresses to physical memory addresses. However, I/O devices are incapable of utilizing the host computer's MMU to translate virtual memory addresses in I/O requests to physical memory addresses. As a result, conventional I/O devices are presented by the operating system with the physical memory addresses of data processed in I/O operations. In addition, in order to prevent the data to be processed in an I/O operation from being moved to a disk, the operating system locks the virtual memory pages containing the data in main memory for the duration of the I/O operation. The operating system unlocks the virtual pages from main memory when the I/O operation completes. Translating virtual memory addresses to physical memory addresses, locking virtual pages in main memory, and unlocking pages in response to each I/O operation is processor-intensive and increases latency in I/O operations.
In order to increase the efficiency of I/O operations, some I/O devices perform virtual to physical address translations by storing tables mapping virtual memory addresses to physical memory addresses in memory local to the I/O devices. However, these I/O devices are unable to recover if local address translation fails. As a result, the I/O devices require registration and locking of memory regions used in I/O operations prior to performing an I/O operation. Memory registration is initiated by application-level code. The result of memory registration is a memory handle that the application communicates to the I/O device when requesting an I/O operation. The I/O device uses the handle to verify and translate the virtual memory address to a physical memory address. When an application completes use of a memory region, the application deregisters the memory region with the I/O device. Although using memory handles allows applications to specify virtual memory addresses rather than physical memory addresses to I/O devices, registering and deregistering memory regions adds complexity to application programs.
Another problem with conventional I/O devices that require locking of I/O buffers in main memory is that locking may result in inefficient usage of main memory. For example, locking prevents main memory from being used by other applications, even when the locking application is not using the pages stored in main memory. In addition, most operating systems limit the amount of main memory that can be locked by an application to a small percentage, e.g., about sixteen percent, of main memory. The limit on the amount of main memory that can be locked may adversely affect the I/O performance of applications that require locking.
In light of these difficulties, there exists a need for recoverable methods and systems for processing I/O requests that allows applications to specify virtual memory addresses to I/O devices and that reduce the need for preregistration of memory regions or locking of memory regions in main memory.